package main

import (
	"fmt"
	"math/rand"
	"sort"
	"time"
)

// 定义A结构体
type A struct {
	arg  uint64
	name string
}

func main() {
	arr := make([]A, 1_000_000)
	for i := range arr {
		arr[i] = A{arg: rand.Uint64(), name: fmt.Sprintf("%d", rand.Uint64())}
	}

	start := time.Now()
	sort.Slice(arr, func(i, j int) bool { return arr[i].arg < arr[j].arg })
	d := time.Since(start)

	fmt.Printf("%vms\n", d.Milliseconds())
}
